/*
 * MIT License
 *
 * Copyright (c) 2020 Mr.css
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 *
 */

package cn.seaboot.postman.root;

import cn.seaboot.postman.request.Request;
import cn.seaboot.postman.response.Response;

import java.util.Arrays;

/**
 * 每一个{@link Item}对应于一个API，包含{@link Request} 和 {@link Response}，
 * 也可以用于构造树形节点，包含子级的{@link Item}
 * <p>
 * Items are entities which contain an actual HTTP request, and sample responses attached to it.
 *
 * @author Mr.css
 * @date 2020-01-28 10:44
 */
public class Item {
    private String name;
    private Item[] item;
    private Request request;
    private Response[] response;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Item[] getItem() {
        return item;
    }

    public void setItem(Item[] item) {
        this.item = item;
    }

    public Request getRequest() {
        return request;
    }

    public void setRequest(Request request) {
        this.request = request;
    }

    public Response[] getResponse() {
        return response;
    }

    public void setResponse(Response... response) {
        this.response = response;
    }

    @Override
    public String toString() {
        return "Item{" +
                "name='" + name + '\'' +
                ", item=" + Arrays.toString(item) +
                ", request=" + request +
                ", response=" + Arrays.toString(response) +
                '}';
    }
}
